#include <string>
#include <vector>


#include "data_models.h"
#include "util.h"
#include "highlighting.h"
#include "file_type.h"

class Row{
public:
    Row(std::string);
    ~Row();

    bool IsHighlighted=false;


    std::string Render(int,int);
    int Length();
    bool IsEmpty();
    void Insert(int at,char c);
    void Delete(int at);
    void Append(Row* newRow);
    Row* Split(int at);
    const char* GetContent();
    int Find(std::string str,int at,SearchDirection direction);
    bool Highlight(HighlightingOptions opts, std::string str,bool start_with_comment);
    void HighlightMatch(std::string word);
    bool HighlightChar(int* index,HighlightingOptions opts,char c,const char* str);
    bool HighlightComment(int* index,HighlightingOptions opts,char c,const char* str);
    bool HighlightString(int* index,HighlightingOptions opts,char c,const char* str);
    bool HighlightNumber(int* index,HighlightingOptions opts,char c,const char* str);
    bool HighlightStr(int* index,std::string substring,const char* chars,HighlightingType hl_type);
    bool HighlightPrimaryKeywords(int* index,HighlightingOptions opts,const char* chars);
    bool HighlightSecondaryKeywords(int* index,HighlightingOptions opts,const char* chars);
    bool HighlightMultilineComments(int* index,HighlightingOptions opts,char c,const char* str);

private:
    
    std::string* _content;
    unsigned int _len=0;
    std::vector<HighlightingType> _highlighting;

    void update_len();




};
